<template>
  <!-- 选择角色 -->
  <el-dialog title="选择角色" :visible="value" width="300px" custom-class="dialog-box" @close="onClose" @open="onOpen" :close-on-click-modal="false" :modal-append-to-body="false">
    <ul class="select-role-login">
      <li v-for="(item,index) in roleList" :key="index" @click="onSelectRole(item)">
        {{item.roleName}}
      </li>
    </ul>
  </el-dialog>
</template>
<script>
export default {
  props: ["value", "roleList"],
  methods: {
    onSelectRole(obj) {
      let th = this;
      th.$emit("selectRole", obj);
      th.onClose();
    },
    onOpen() {},
    onClose() {
      let th = this;
      th.$emit("input", false);
    }
  }
};
</script>
<style lang="scss">
.select-role-login {
  margin: 0;
  padding: 0;
  width: 100%;
  > li {
    list-style: none;
    width: 100%;
    height: 55px;
    border: 1px solid #eee;
    margin-bottom: 10px;
    text-align: center;
    font-size: 18px;
    line-height: 55px;
    &:hover {
      background-color: $primary-color;
      cursor: pointer;
      color: white;
    }
  }
}
</style>

